/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gew.data;

import java.io.Serializable;
import java.util.Date;

public class LoadRequest implements Serializable {

    public static final int SQL_ID = 0;
    public static final int SQL_URL = 1;
    public static final int SQL_FILENAME = 2;
    public static final int SQL_START = 3;
    public static final int SQL_END = 4;
    public static final int SQL_STATUS = 5;
    public static final int SQL_COUNT = 6;
    
    public final static Integer STATUS_READY = 0;
    public final static Integer STATUS_EXECUTION = 2;
    public final static Integer STATUS_COMPLETED = 3;
    public final static Integer STATUS_LOAD_ERROR = 4;
    
    public final static Integer STATUS_LOCAL_READY = 10;
    public final static Integer STATUS_LOCAL_EXECUTION = 12;
    public final static Integer STATUS_LOCAL_COMPLETED = 13;
    public final static Integer STATUS_LOCAL_LOAD_ERROR = 14;

    private final Integer loadRequestId;
    private final String url;
    private final String filename;
    private Date loadRequestStart;
    private Date loadRequestEnd;
    private Integer status;
    private Integer count;

    public LoadRequest(Integer loadRequestId, String url, String filename, Date loadRequestStart, Date loadRequestEnd, Integer status, Integer count) {
        this.loadRequestId = loadRequestId;
        this.url = url;
        this.filename = filename;
        this.loadRequestStart = loadRequestStart;
        this.loadRequestEnd = loadRequestEnd;
        this.status = status;
        this.count = count;
    }

    public Integer getLoadRequestId() {
        return loadRequestId;
    }

    public String getUrl() {
        return url;
    }

    public String getFilename() {
        return filename;
    }

    public Date getLoadRequestStart() {
        return loadRequestStart;
    }

    public void setLoadRequestStart(Date loadRequestStart) {
        this.loadRequestStart = loadRequestStart;
    }

    public Date getLoadRequestEnd() {
        return loadRequestEnd;
    }

    public void setLoadRequestEnd(Date loadRequestEnd) {
        this.loadRequestEnd = loadRequestEnd;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (loadRequestId != null ? loadRequestId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof LoadRequest)) {
            return false;
        }
        LoadRequest other = (LoadRequest) object;
        if ((this.loadRequestId == null && other.loadRequestId != null) || (this.loadRequestId != null && !this.loadRequestId.equals(other.loadRequestId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "gew.data.LoadRequest[ loadRequestId=" + loadRequestId + " ]";
    }

}
